//
// Created by v on 24-5-13.
//

#include <getopt.h>
#include <assert.h>
#include <unistd.h>

#include "cm_discovery_service.h"
#include "utils/rt_print.h"
#include "cm_thread_task_manager.h"

void test_discovery_func()
{
    CMThreadTaskManager taskManager;
    taskManager.debug();
    taskManager.start();

    CMDiscoveryService discoveryService;
    discoveryService.start(8899, 8898);
    taskManager.addToThread(&discoveryService, "Discovery");

    int c = 0;
    while (c++ < 110)
    {
        sleep(1);
    }

    discoveryService.stop();
    taskManager.stop();
}

int main(int argc, char **args)
{
    rt_print_init(RT_PRINT_ALL, RT_PRINT_STYLE_ALL, 1, "clientOne");
    rtdebug("build_at [%s: %s]\n", __DATE__, __TIME__);

    test_discovery_func();

    return 0;
}
